package kr.hkit.powerjava.chapter24;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;

import javax.imageio.stream.FileImageInputStream;

public class StudentDao  implements InterfaceStudent<Student>{
private static final String 
	private ArrayList<Student> arlList;
	@Override
	public void insertItem(Student item) {
		arlList = loadList();
		
	}

	@Override
	public void deleteItem(Student item) {
	arlList.remove(item);
		
	}

	@Override
	public void updateItem(Student item) {
		arlList.set(arlList.indexOf(item), item);
		
	}

	@Override
	public void prnItem() {
		for(Student std : arlList){
			System.out.println(std);
		}
		
	}
	
	public void prn

	@Override
	public Student searchItem(Student item) {
		if (arlList.contains(item)){
			return arlList
		}
		return null;
	}

	@Override
	public ArrayList<Student> loadList() {
		ObjectInputStream ois =null;
		try{
			ois = new ObjectInputStream(new BufferedInputStream(new FileImageInputStream(Student)));
			list = (ArrayList<Student>) ois.readObject();
		}catch (Exception e){
			new FileInputStream((StudentDao.File);
		}finally{
			if (ois != null)try{ois.close();}catch (Exception e) {}
		}
		return list;
	}

	@Override
	public void saveList() {
		ObjectOutputStream oos =null;
		ArrayList<E>
		
	}

}
